package com.uplooking.service;

import com.uplooking.dao.DBUtil;
import org.apache.commons.dbutils.QueryRunner;

import javax.sql.DataSource;
import java.sql.SQLException;

public class AlterArtical {
    public Integer getAlterArtical(Integer id,String title,String artical) throws SQLException {
        DataSource c3P0ConnctionPool = DBUtil.getC3P0ConnctionPool();
        QueryRunner queryRunner = new QueryRunner(c3P0ConnctionPool);
        Object[] objects ={title,artical,id};
        int update = queryRunner.update("update artical set tital = ?, artical = ? where id =?", objects);
        return update;
    }
}
